package com.baosight.risk.web.quartz;

import com.baosight.risk.api.quartz.ISysJobLogService;
import com.baosight.risk.base.controller.BaseController;
import com.baosight.risk.common.result.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.core.MediaType;

/**
 * @author lishaoqing
 * <p>
 * 定时任务日志
 */
@Slf4j
@RestController
@RequestMapping("system/job/log")
@Api(value = "定时任务日志", description = "定时任务日志", produces = MediaType.APPLICATION_JSON)
public class SysJobLogController extends BaseController {

    @Autowired
    private ISysJobLogService jobLogService;

    /**
     * 返回集合列表
     */
    @GetMapping("/list")
    @ApiOperation("查询定时任务日志")
    public AjaxResult query(String jobName) {
        startPage("t.createTime", "desc");
        return getResultPage(jobLogService.selectJobLog(jobName));
    }

}
